package com.funcourse.demo.api.restful.upload;

import com.funcourse.demo.util.RandomString;
import java.util.Random;
import org.springframework.stereotype.Component;

@Component
public class QuestionsCoverPathManager {

  private static final String PATH_COVER="/funCourse/cover";

  private static final String QR_CODE_PREFIX="qrCodeCompeteRoom";

  public String getPathOfQuestionCover(Long questionSuitId) {
    Random random = new Random();
    random.setSeed(questionSuitId);
    RandomString randomString = new RandomString(10, random);
    return PATH_COVER+"/"+randomString.nextString();
  }

  public String getPathOfQuestionCover() {
    RandomString randomString = new RandomString(10, new Random());
    return randomString.nextString()+System.currentTimeMillis();
  }

  public String getQrCodePath(String competeRoomId){
    return QR_CODE_PREFIX+competeRoomId;
  }

}
